cmake_minimum_required(VERSION 3.28)
project(c_case C)

set(CMAKE_C_STANDARD 11)

add_executable(main src/main.c)
add_executable(struct-define-init src/struct/struct-define-init.c)
add_executable(access-struct-member src/struct/access-struct-member.c)
add_executable(struct-as-function-parameter src/struct/struct-as-function-parameter.c)
add_executable(struct-pointer-as-function-parameter src/struct/struct-pointer-as-function-parameter.c)
add_executable(calculate-struct-size src/struct/calculate-struct-size.c)
add_executable(union-declare-define src/union/union-declare-define.c)
add_executable(access-union-member-incorrect src/union/access-union-member-incorrect.c)
add_executable(access-union-member-correct src/union/access-union-member-correct.c)
add_executable(struct-and-bit-field src/bitfield/struct-and-bit-field.c)
add_executable(declare-use-bit-field src/bitfield/declare-use-bit-field.c)
add_executable(declare-use-bit-field-1 src/bitfield/declare-use-bit-field-1.c)
add_executable(use-bit-field-by-pointer src/bitfield/use-bit-field-by-pointer.c)
add_executable(bit-field-memsize-test src/bitfield/bit-field-memsize-test.c)
add_executable(typedef-vs-define src/typedef/typedef-vs-define.c)
add_executable(getchar-and-putchar src/io/getchar-and-putchar.c)
add_executable(gets-and-puts src/io/gets-and-puts.c)
add_executable(scanf-and-printf src/io/scanf-and-printf.c)
add_executable(sizeof src/datatype/sizeof.c)
add_executable(type-cast src/datatype/type-cast.c)
add_executable(file-read-write src/filereadwrite/file-read-write.c)
add_executable(parse-csv-file src/filereadwrite/parse-csv-file.c)
add_executable(file-write src/filereadwrite/file-write.c)
add_executable(file-read src/filereadwrite/file-read.c)
add_executable(2d-array-addressing src/array/2d-array-addressing.c)
add_executable(array src/array/array.c)
add_executable(2d-array-step-size src/array/2d-array-step-size.c)
add_executable(file-seek src/filereadwrite/file-seek.c)
add_executable(predefine-macro src/preprocessor/predefine-macro.c)
add_executable(string-constant src/preprocessor/operator/string-constant.c)
add_executable(mark-paste src/preprocessor/operator/mark-paste.c)
add_executable(defined src/preprocessor/operator/defined.c)
add_executable(parameterized-macro src/preprocessor/parameterized-macro.c)
add_executable(bit-operation src/operator/bit-operation.c)
add_executable(precedence-of-operator src/operator/precedence-of-operator.c)
add_executable(assignment-operation src/operator/assignment-operation.c)
add_executable(miscellaneous-operation src/operator/miscellaneous-operation.c)
add_executable(force-type-cast src/datatype/force-type-cast.c)
add_executable(integer-lifting src/datatype/integer-lifting.c)
add_executable(arithmetic-conversion src/datatype/arithmetic-conversion.c)
add_executable(char-short-convert-to-int src/datatype/char-short-convert-to-int.c)
add_executable(decimals-to-int src/datatype/decimals-to-int.c)
add_executable(int-to-decimals src/datatype/int-to-decimals.c)
add_executable(short-type-to-long-type src/datatype/short-type-to-long-type.c)
add_executable(long-type-to-short-type src/datatype/long-type-to-short-type.c)
add_executable(unsigned-to-signed src/datatype/unsigned-to-signed.c)
add_executable(signed-to-unsigned src/datatype/signed-to-unsigned.c)
add_executable(errno-perror-strerror src/errorhandling/errno-perror-strerror.c)
add_executable(extern-constant src/extern/constant/file2.c
        src/extern/constant/file3.c)
add_executable(extern-func src/extern/func/file1.c
        src/extern/func/file2.c)
add_executable(extern-func-1 src/extern/func-1/file1.c
        src/extern/func-1/file2.c
        src/extern/func-1/file3.c)
add_executable(extern-var-func src/extern/var-func/file1.c
        src/extern/var-func/file2.c)
add_executable(extern-var-func-1 src/extern/var-func-1/file1.c
        src/extern/var-func-1/file3.c)
add_executable(c-extern src/extern/c-extern.c)
add_executable(extern-var-func-2 src/extern/var-func-2/file1.c
        src/extern/var-func-2/file2.c)
add_executable(by-zero-error src/errorhandling/by-zero-error.c)
add_executable(factorial src/recursion/factorial.c)
add_executable(fibonacci src/recursion/fibonacci.c)
add_executable(variable-parameter src/variableparameter/variable-parameter.c)
add_executable(variable-parameter-1 src/variableparameter/variable-parameter-1.c)
add_executable(variable-parameter-2 src/variableparameter/variable-parameter-2.c)
add_executable(variable-parameter-3 src/variableparameter/variable-parameter-3.c)
add_executable(dynamic-memory-allocation src/memmgmt/dynamic-memory-allocation.c)
add_executable(realloc-free-memory src/memmgmt/realloc-free-memory.c)
add_executable(bubble-sort src/sortalgorithm/bubble-sort.c)
add_executable(selection-sort src/sortalgorithm/selection-sort.c)
add_executable(insertion-sort src/sortalgorithm/insertion-sort.c)
add_executable(shell-sort src/sortalgorithm/shell-sort.c)
add_executable(merge-sort-iteration src/sortalgorithm/merge-sort-iteration.c)
add_executable(merge-sort-recursion src/sortalgorithm/merge-sort-recursion.c)
add_executable(quick-sort-iteration src/sortalgorithm/quick-sort-iteration.c)
add_executable(quick-sort-recursion src/sortalgorithm/quick-sort-recursion.c)
add_executable(parse-csv-and-insert-into-mysql src/filereadwrite/parse-csv-and-insert-into-mysql.c)
add_executable(constant src/constant/constant.c)

target_link_libraries(parse-csv-and-insert-into-mysql -lmysqlclient)